package com.qf.chat.entity;


import com.qf.chat.commons.base.BaseEntity;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * 用户表(User)表实体类
 *
 * @author makejava
 * @since 2024-01-12 10:46:27
 */
@Data
@Accessors(chain = true)
public class User extends BaseEntity {
    //用户名
    @NotBlank(message = "用户名不能为空！")
    @Length(min = 4, max = 20, message = "用户名长度必须在{min}到{max}之间！")
    private String username;
    //密码
    @NotBlank(message = "密码不能为空！")
    @Length(min = 6, max = 20, message = "密码长度必须在{min}到{max}之间！")
    private String password;
    //
    @NotBlank(message = "昵称不能为空！")
    private String nickname;
    //头像
    @NotBlank(message = "必须上传头像！")
    private String header;
    //邮箱
    @NotBlank(message = "邮箱不能为空！")
    @Email(message = "邮箱地址不正确！")
    private String email;
    //昵称的拼音
    private String pinyin;
}

